package com.ae.shield.common.enchantment.shieldSuffix;

import net.minecraft.enchantment.Enchantment;

import javax.annotation.Nonnull;

public class HighFrequency extends SuffixBase {
    public HighFrequency() {
        super(new SuffixRate()
                .intensity(0.5f, 2)
                .piles(2f, 2));
    }

    @Override
    public float levelRate(int level, SuffixProperty property, float rate) {
        switch (property) {
            case INTENSITY:
                return rate - (level - 1) * 0.2f;
            case PILES:
                switch (level) {
                    case 1:
                        return 2;
                    case 2:
                        return 4;
                    case 3:
                        return 14;
                }
            default: return rate;
        }
    }

    @Override
    protected boolean canApplyTogether(@Nonnull Enchantment enchantment) {
        return enchantment != SuffixList.LOW_FREQUENCY.get() && super.canApplyTogether(enchantment);
    }
}
